import os
import re
import threading

import pytz
from datetime import datetime


def get_local_file_mod_time(fullname):
    # 获取文件最后修改时间
    modified_time = os.path.getmtime(fullname)
    modified_time = datetime.fromtimestamp(modified_time, tz=pytz.utc)

    return modified_time


def find_thread_by_name_regex(pattern):
    for thread in threading.enumerate():
        if re.search(pattern, thread.name):
            print(f"匹配到相应的线程： {pattern} ==> {thread} ")
            return True
    return False